package com.magnificent.panda.model.generator.flow;

import java.util.HashSet;
import java.util.Set;

/**
 * User: Babanin
 * Date: May 20, 2010
 * Time: 6:06:12 PM
 */
public abstract class AbstractFlow {
    public AbstractFlow(int intensity1, int intensity2, int modellingTime) {
    }

    public abstract double[] generate();

    public int[] generateInt() {
        Set<Integer> values = new HashSet<Integer>();
        for (double value : generate()) {
            values.add((int) value);
        }

        int i = 0;
        int[] result = new int[values.size()];
        for (Integer value : values) {
            result[i++] = value;
        }

        return result;
    }
}

  /* converted to utf8 */